# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mutator
pkgver=v0.2.2.r2.g164132d
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-automation' 'blackarch-misc')
pkgdesc='This project aims to be a wordlist mutator with hormones, which means that some mutations will be applied to the result of the ones that have been already done, resulting in something like: corporation -> C0rp0r4t10n_2012'
arch=('x86_64' 'aarch64')
url='https://bitbucket.org/alone/mutator/'
license=('GPL3')
makedepends=('git')
source=("git+https://bitbucket.org/alone/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" INSTALL README TODO
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

